﻿using System;
using System.Collections.Generic;
using System.Text;
using Pixysoft.Framework.Reflection;
using Pixysoft.Weblications.Sango.Dao;
using Pixysoft.Weblications.Sango.Constant;
using Pixysoft.Weblications.Sango.Protocol.player;
using Pixysoft.Weblications.Sango.Protocol;
using Pixysoft.Weblications.Sango.Protocol.party;
using System.Data;
using Pixysoft.Framework.Noebe;

namespace Pixysoft.Weblications.Sango.Command.party
{
    partial class SangoPartyHandler
    {
        public party_detail party_detail()
        {
            string userCode = SangoManager.Authentication();

            party_detail response = ReflectionManager.CreatePojo<party_detail>();
            response.Succeed = false;

            Entities.Usr_Partymember member = PartyDao.tryGetActiveMember(userCode);

            if (member == null)
            {
                response.Message = "非军团成语那";
                return response;
            }

            Entities.Usr_Party party = PartyDao.tryGetActiveParty(member.Partyprimarycode);

            DataTable members = PartyDao.getActiveProfilesGreatThanTitle(party.Primarycode, PtyTitleSerialcodeCollection.POSITION_2);

            response.party = PartyFacade.ToParty(party);
            response.members = PartyFacade.ToListMembers(members);
            response.Succeed = true;
            return response;
        }


    }
    public interface party_detail : ISangoResponse
    {
        List<party_listmember> members { get;set;}

        party_party party { get;set;}
    }
}
